Out-link specific attribute modify date

Let me explain what i'm trying to do:

In a script I get the outlink ID, and the condition that I named Validation Status, so far its okay.

And, yes, I know that I can do it with the wizard, but i don't wanna.

Continue...the other information I desired is the date when the attribute Validation Status was last modified.
ps: the Validation Status from the outlink module.
The problem is if I use the attribute Last Modified On, it will return to me the last modification in the object, and not in the attribute I want.

So how do i get the date of a specific attribute of an outlink module.

Below is the script, simple not one of the bests, but it's a part of an idea.
 

Link l
Object o = current
Object po
 
for l in o -> "*" do {
po = target l
string val = po."Validation Status"
string valid = identifier po
 
print " Parent/ Out-link  " valid " | Validation Status:  " val  "  |  that was modified on:  " 
}

Bruwbruw - Wed May 16 13:27:02 EDT 2012

Re: Out-link specific attribute modify date
llandale - Wed May 16 15:00:46 EDT 2012

I think this:

noError()    // History access is very fickle
History hst
string  NameAttr
Date    datHist = null
for hst in po do
{  NameAttr = hst.attrName
   if (NameAttr == "Validation Status") then datHist = hst.date
}
datHist is the date ValStatus was modified, if any.
lastError()


Won't work if it was modified in a baseline.

-Louie

Re: Out-link specific attribute modify date
Bruwbruw - Thu May 17 13:18:24 EDT 2012

llandale - Wed May 16 15:00:46 EDT 2012

I think this:

noError()    // History access is very fickle
History hst
string  NameAttr
Date    datHist = null
for hst in po do
{  NameAttr = hst.attrName
   if (NameAttr == "Validation Status") then datHist = hst.date
}
datHist is the date ValStatus was modified, if any.
lastError()


Won't work if it was modified in a baseline.

-Louie

It worked.

noError()    // History access is very fickle
Link l
Object o = current
Object po
History hst
string  NameAttr
Date    datHist = null
 
for l in o -> "*" do {
po = target l
string val = po."Validation Status"
string valid = identifier po
   for hst in po do{
       NameAttr = hst.attrName
       if (NameAttr == "Validation Q1") {
       datHist = hst.date
    }
 
}
//datHist is the date Validation Q1 was modified
 
print " Parent  " valid " | Validation Status:  " val  "  |  last modified on:  " datHist "\n"
 
}
lastError()

 


But then i notice that its only show to me the link values for which the target object is loaded. And I dont wanna to open the target module, because once I do, theres no need to use the script since the module is already open.

The DOORS DXL Reference Manual, shows me some examples but they only work with inlinks, and my case is with out-link.

Anyway thanks for the help.

XD

 

Re: Out-link specific attribute modify date
llandale - Thu May 17 13:51:07 EDT 2012

Bruwbruw - Thu May 17 13:18:24 EDT 2012

It worked.

noError()    // History access is very fickle
Link l
Object o = current
Object po
History hst
string  NameAttr
Date    datHist = null
 
for l in o -> "*" do {
po = target l
string val = po."Validation Status"
string valid = identifier po
   for hst in po do{
       NameAttr = hst.attrName
       if (NameAttr == "Validation Q1") {
       datHist = hst.date
    }
 
}
//datHist is the date Validation Q1 was modified
 
print " Parent  " valid " | Validation Status:  " val  "  |  last modified on:  " datHist "\n"
 
}
lastError()

 


But then i notice that its only show to me the link values for which the target object is loaded. And I dont wanna to open the target module, because once I do, theres no need to use the script since the module is already open.

The DOORS DXL Reference Manual, shows me some examples but they only work with inlinks, and my case is with out-link.

Anyway thanks for the help.

XD

 

For outlinks to a module that is closed, you can get the Module and the Object AbsNo of the target object, but that's it. You must open that other module to see things like "Objects" and "Attributes" values.

Since you figure to display that other Object's last modified date in THIS module, I don't see the problem with opening the other module invisibly so you can get that info.

-Louie

Re: Out-link specific attribute modify date
Bruwbruw - Fri May 18 14:06:29 EDT 2012

Okay i did it, thank very much! XD...
Now the out link module does not open.
 

noError()    // History access is very fickle
Link lnk
Object o = current
Object po
History hst                                             
string  NameAttr
Date    datHist = null
Date    datHist2 = null
ModName_ trgModRef
 
for lnk in o -> "*" do {
ModuleVersion modVer = targetVersion lnk
trgModRef = module(modVer)      
po = target     lnk     
                if(null datHist){
                                load(modVer, false)
                        }     
        for hst in o do{
       NameAttr = hst.attrName
       if ((NameAttr == "Validation Q1") || (NameAttr == "Validation Q1HF")) {
       datHist = hst.date
        }
    }
                for hst in po do{
                   if (hst.type == modifyObject) {
                        if (hst.attrName == "Validation Q1") {
                                    if (hst.date >= datHist) {
                    datHist2 = hst.date
                    }                        
               }
        }    
 }
        
string valid = identifier po
string val = po."Validation Status"
//datHist is the date Validation Q1 was modified, it won't work in modifications that ocurred before the current baseline
 
print " Parent  ID  " valid "  |  Parent Validation Status:  " val  "   |   Parent Validation last modified on:  " datHist2  "  |  Requirement Validation Status last modified on:  " datHist " \n"   
 
}   
lastError()


Now i'm trying to get the date of the modification in the out-link baseline, if the modification happened before the baseline is saved.
I'm just send the code for see if I get some idea in my mind that help me understand what is wrong.
Maybe a weekend at home help me. XD
But my first and most importante doubt is already answered...thank you.

 

 

noError()    // History access is very fickle
Link lnk
Object o = current
Object po
Object basObj
History hst                                             
string  NameAttr
Date    datHist = null
Date    datHist2 = null
ModName_ trgModRef
Baseline basMod
Module modBaselined
int countBas
Skip basSkip = create()
 
for lnk in o -> "*" do {
ModuleVersion modVer = targetVersion (lnk)
trgModRef = module(modVer)      
po = target     lnk     
                if(null datHist){
                                load(modVer, false)
                        }    
        for hst in o do{
       NameAttr = hst.attrName
       if ((NameAttr == "Validation Q1") || (NameAttr == "Validation Q1HF")) {
       datHist = hst.date
        }
    }
                for hst in po do{
                   if (hst.type == modifyObject) {
                        if (hst.attrName == "Validation Q1") {
                                    if (hst.date >= datHist) {
                    datHist2 = hst.date
                    }                        
        }
        }    
 }
 
 countBas = 0
 for basMod in modVer do {
                countBas++
        }
 
        for basMod in modVer do {
                put(basSkip, countBas, basMod)
                countBas--
        }
                
        absNoObj = basObj."Absolute Number"
        // Check for change in each baseline
        for basMod in basSkip do {
                
                modBaselined = load(basMod, false)
                basObj = gotoObject(absNoObj, modBaselined)
                
                if (!null basObj) {
                        for hst in basObj do {
                                NameAttr = "Validation Q1"
                                noError()
                                NameAttr = hst.attrName
                                ErrMess = lastError()
                                noError()
                                
                                if (hst.type == modifyObject) {
                                ErrMess = lastError()
                                    if (hst.attrName == "Validation Q1") {         
                                                if (hst.date >= datHist) {
                                                        datHist2 = hst.date
                                                        
                                                }
                                     }                                               
                          }
                 }
          }
    }                
string valid = identifier po
string val = po."Validation Status"
//datHist is the date Validation Q1 was modified, it won't work in modifications that ocurred before the current baseline
 
print " Parent  ID  " valid "  |  Parent Validation Status:  " val  "   |   Parent Validation last modified on:  " datHist2  "  |  Requirement Validation Status last modified on:  " datHist " \n"   
 
}   
lastError()

 

 

Re: Out-link specific attribute modify date
kmar - Tue Jul 23 18:28:25 EDT 2013

Bruwbruw - Fri May 18 14:06:29 EDT 2012

Okay i did it, thank very much! XD...
Now the out link module does not open.
 

noError()    // History access is very fickle
Link lnk
Object o = current
Object po
History hst                                             
string  NameAttr
Date    datHist = null
Date    datHist2 = null
ModName_ trgModRef
 
for lnk in o -> "*" do {
ModuleVersion modVer = targetVersion lnk
trgModRef = module(modVer)      
po = target     lnk     
                if(null datHist){
                                load(modVer, false)
                        }     
        for hst in o do{
       NameAttr = hst.attrName
       if ((NameAttr == "Validation Q1") || (NameAttr == "Validation Q1HF")) {
       datHist = hst.date
        }
    }
                for hst in po do{
                   if (hst.type == modifyObject) {
                        if (hst.attrName == "Validation Q1") {
                                    if (hst.date >= datHist) {
                    datHist2 = hst.date
                    }                        
               }
        }    
 }
        
string valid = identifier po
string val = po."Validation Status"
//datHist is the date Validation Q1 was modified, it won't work in modifications that ocurred before the current baseline
 
print " Parent  ID  " valid "  |  Parent Validation Status:  " val  "   |   Parent Validation last modified on:  " datHist2  "  |  Requirement Validation Status last modified on:  " datHist " \n"   
 
}   
lastError()


Now i'm trying to get the date of the modification in the out-link baseline, if the modification happened before the baseline is saved.
I'm just send the code for see if I get some idea in my mind that help me understand what is wrong.
Maybe a weekend at home help me. XD
But my first and most importante doubt is already answered...thank you.

 

 

noError()    // History access is very fickle
Link lnk
Object o = current
Object po
Object basObj
History hst                                             
string  NameAttr
Date    datHist = null
Date    datHist2 = null
ModName_ trgModRef
Baseline basMod
Module modBaselined
int countBas
Skip basSkip = create()
 
for lnk in o -> "*" do {
ModuleVersion modVer = targetVersion (lnk)
trgModRef = module(modVer)      
po = target     lnk     
                if(null datHist){
                                load(modVer, false)
                        }    
        for hst in o do{
       NameAttr = hst.attrName
       if ((NameAttr == "Validation Q1") || (NameAttr == "Validation Q1HF")) {
       datHist = hst.date
        }
    }
                for hst in po do{
                   if (hst.type == modifyObject) {
                        if (hst.attrName == "Validation Q1") {
                                    if (hst.date >= datHist) {
                    datHist2 = hst.date
                    }                        
        }
        }    
 }
 
 countBas = 0
 for basMod in modVer do {
                countBas++
        }
 
        for basMod in modVer do {
                put(basSkip, countBas, basMod)
                countBas--
        }
                
        absNoObj = basObj."Absolute Number"
        // Check for change in each baseline
        for basMod in basSkip do {
                
                modBaselined = load(basMod, false)
                basObj = gotoObject(absNoObj, modBaselined)
                
                if (!null basObj) {
                        for hst in basObj do {
                                NameAttr = "Validation Q1"
                                noError()
                                NameAttr = hst.attrName
                                ErrMess = lastError()
                                noError()
                                
                                if (hst.type == modifyObject) {
                                ErrMess = lastError()
                                    if (hst.attrName == "Validation Q1") {         
                                                if (hst.date >= datHist) {
                                                        datHist2 = hst.date
                                                        
                                                }
                                     }                                               
                          }
                 }
          }
    }                
string valid = identifier po
string val = po."Validation Status"
//datHist is the date Validation Q1 was modified, it won't work in modifications that ocurred before the current baseline
 
print " Parent  ID  " valid "  |  Parent Validation Status:  " val  "   |   Parent Validation last modified on:  " datHist2  "  |  Requirement Validation Status last modified on:  " datHist " \n"   
 
}   
lastError()

 

 

I tried implementing this code but am having some difficulty, I am just trying to obtain the outlink's ID and was trying to use the absNoObj could someone clarify which lines of code i specifically need?

Thanks

Re: Out-link specific attribute modify date
kmar - Wed Jul 24 09:20:19 EDT 2013

kmar - Tue Jul 23 18:28:25 EDT 2013

I tried implementing this code but am having some difficulty, I am just trying to obtain the outlink's ID and was trying to use the absNoObj could someone clarify which lines of code i specifically need?

Thanks

I was able to figure it out.